package com.ruoyi.web.controller.user;


import com.hxzy.user.entity.TtBankAccount;
import com.hxzy.user.service.TtBankAccountService;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author mingqian.Wu
 * @since 2023-06-23
 */
@RestController
@RequestMapping("/ttBankAccount")
@DataSource(DataSourceType.USERS)
public class TtBankAccountController {

    @Autowired
    private TtBankAccountService ttBankAccountService;

    /**
     * 根据用户id获取账户信息
     * @param userId
     * @return
     */
    @GetMapping("/getAccountInfo/{userId}")
    public AjaxResult getAccountInfo(@PathVariable String userId) {
        TtBankAccount byId = ttBankAccountService.getById(userId);
        return AjaxResult.success(byId);
    }

}

